Repository navigation
solver: accept a contract state from a peer only in answer to a request - #32
Merged
Merged
Conversation
getStateReply accepted a contract state from any signed peer, and net_update_contract_state cached it whenever no new_state with the same ref was found in the following MaxRoundsCancelContract blocks. A state with a future ref was cached too, and then every real update looked outdated, so a single message froze the contract on this node. Remember the contracts this node asked the confidants about (the round of the last request, kept for 1000 rounds because several confidants answer) and ignore states for any other contract, or with a ref later than the current round. A state whose new_state is not stored yet is still accepted: that is how a lagging node catches up, and refusing it would leave it without the state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getStateReply accepted a contract state from any signed peer, and
net_update_contract_state cached it whenever no new_state with the same ref
was found in the following MaxRoundsCancelContract blocks. A state with a
future ref was cached too, and then every real update looked outdated, so a
single message froze the contract on this node.
Remember the contracts this node asked the confidants about (the round of
the last request, kept for 1000 rounds because several confidants answer)
and ignore states for any other contract, or with a ref later than the
current round. A state whose new_state is not stored yet is still accepted:
that is how a lagging node catches up, and refusing it would leave it
without the state.
Testing
test/phase1-combined(all node fixes) with mixed executors (executor_ref=test/compatible-fixes): 17 of 17 contract calls returned the expected value across the restart test,CounterandLedgerstates equal on all 7 nodes, state digests equal up to sequence 1100.Compatible: no result of a valid contract call changes, so nodes can adopt it one by one.
🤖 Generated with Claude Code